<?php


class LivePackage extends CActiveRecord
{
	
	public static function model($Vgmajjibziuy=__CLASS__)
	{
		return parent::model($Vgmajjibziuy);
	}

	
	public function tableName()
	{
		return 'live_package';
	}

	
	public function rules()
	{
		
		
		return array(
			array('code_name, display_name', 'required'),
			array('is_free, status', 'numerical', 'integerOnly'=>true),
			array('price', 'numerical'),
			array('code_name, display_name', 'length', 'max'=>200),
			array('tags', 'length', 'max'=>500),
			array('description, create_date, modify_date', 'safe'),
			
			
			array('id, code_name, display_name, description, tags, price, is_free, create_date, modify_date, status', 'safe', 'on'=>'search'),
		);
	}

	
	public function relations()
	{
		
		
		return array(
			'livePackageMappings' => array(self::HAS_MANY, 'LivePackageMapping', 'live_package_id'),
		);
	}

	
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'code_name' => 'Code Name',
			'display_name' => 'Display Name',
			'description' => 'Description',
			'tags' => 'Tags',
			'price' => 'Price',
			'is_free' => 'Is Free',
			'create_date' => 'Create Date',
			'modify_date' => 'Modify Date',
			'status' => 'Status',
		);
	}

	
	public function search()
	{
		
		

		$V0v5vsnfxezw=new CDbCriteria;

		$V0v5vsnfxezw->compare('id',$this->id);
		$V0v5vsnfxezw->compare('code_name',$this->code_name,true);
		$V0v5vsnfxezw->compare('display_name',$this->display_name,true);
		$V0v5vsnfxezw->compare('description',$this->description,true);
		$V0v5vsnfxezw->compare('tags',$this->tags,true);
		$V0v5vsnfxezw->compare('price',$this->price);
		$V0v5vsnfxezw->compare('is_free',$this->is_free);
		$V0v5vsnfxezw->compare('create_date',$this->create_date,true);
		$V0v5vsnfxezw->compare('modify_date',$this->modify_date,true);
		$V0v5vsnfxezw->compare('status',$this->status);

		return new CActiveDataProvider($this, array(
			'criteria'=>$V0v5vsnfxezw,
		));
	}
}